From: Fabio Bas Date: Tue, 22 Apr 2025 12:40:33 +0000 (+0200) Subject: [PATCH] Fix a crash when filesystem==nullptr. X-Git-Tag: archive/raspbian/24.12.3-2+rpi1^2~1 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=f77b4d1487e3855096752f8f912052d273ebb554;p=kpmcore.git [PATCH] Fix a crash when filesystem==nullptr. (cherry picked from commit 458ef81f2e424f13cdea44d2d89b8260b463e34e) Co-authored-by: Andrius Štikonas Gbp-Pq: Name upstream_98838306_Fix-a-crash-when-filesystem-nullptr-.patch --- diff --git a/src/plugins/sfdisk/sfdiskbackend.cpp b/src/plugins/sfdisk/sfdiskbackend.cpp index e47c4e5..447c096 100644 --- a/src/plugins/sfdisk/sfdiskbackend.cpp +++ b/src/plugins/sfdisk/sfdiskbackend.cpp @@ -515,6 +515,8 @@ bool SfdiskBackend::updateDevicePartitionTable(Device &d, const QJsonObject &jso */ void SfdiskBackend::readSectorsUsed(const Device& d, Partition& p, const QString& mountPoint) { + if (p.isFileSystemNullptr()) + return; if (!mountPoint.isEmpty() && p.fileSystem().type() != FileSystem::Type::LinuxSwap && p.fileSystem().type() != FileSystem::Type::Lvm2_PV) { const QStorageInfo storage = QStorageInfo(mountPoint); if (p.isMounted() && storage.isValid())